//package com.manor.common.dialog;
//
//import android.os.Bundle;
//import android.view.Gravity;
//import android.view.Window;
//import android.view.WindowManager;
//
//import com.manor.common.R;
//import com.manor.common.adapter.CommonShareAdapter;
//import com.manor.common.interfaces.OnItemClickListener;
//import com.manor.common.mob.MobBean;
//
//import androidx.recyclerview.widget.GridLayoutManager;
//import androidx.recyclerview.widget.RecyclerView;
//
///**
// * Created by cxf on 2018/10/19.
// * 直播分享弹窗
// */
//
//public class CommonShareDialogFragment extends AbsDialogFragment implements OnItemClickListener<MobBean> {
//
//    private RecyclerView mRecyclerView;
//    private ActionListener mActionListener;
//
//    @Override
//    protected int getLayoutId() {
//        return R.layout.dialog_live_share;
//    }
//
//    @Override
//    protected int getDialogStyle() {
//        return R.style.dialog_sd;
//    }
//
//    @Override
//    protected boolean canCancel() {
//        return true;
//    }
//
//    @Override
//    protected void setWindowAttributes(Window window) {
//        window.setWindowAnimations(R.style.bottomToTopAnim);
//        WindowManager.LayoutParams params = window.getAttributes();
//        params.width = WindowManager.LayoutParams.MATCH_PARENT;
//        params.height = WindowManager.LayoutParams.WRAP_CONTENT;
//        params.gravity = Gravity.BOTTOM;
//        window.setAttributes(params);
//    }
//
//    @Override
//    public void onActivityCreated(Bundle savedInstanceState) {
//        super.onActivityCreated(savedInstanceState);
//        mRecyclerView = (RecyclerView) mRootView.findViewById(R.id.recyclerView);
//        mRecyclerView.setHasFixedSize(true);
//
//        mRecyclerView.setLayoutManager(new GridLayoutManager(mContext, 3 , GridLayoutManager.VERTICAL,
//                false));
//        CommonShareAdapter adapter = new CommonShareAdapter(mContext);
//        adapter.setOnItemClickListener(this);
//        mRecyclerView.setAdapter(adapter);
//    }
//
//    @Override
//    public void onItemClick(MobBean bean, int position) {
//        if(!canClick()){
//            return;
//        }
//        dismiss();
//        if(mActionListener!=null){
//            mActionListener.onItemClick(bean.getType());
//        }
//    }
//
//    public interface ActionListener{
//        void onItemClick(String type);
//    }
//
//    public void setActionListener(ActionListener actionListener) {
//        mActionListener = actionListener;
//    }
//
//    @Override
//    public void onDestroy() {
//        super.onDestroy();
//        mContext=null;
//        mActionListener=null;
//    }
//}
